Integrand size = 20, antiderivative size = 145 \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\frac {2 a^2 \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a^2 \cos \left (2 e-\frac {2 c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{2 d} \]
1/2*a^2*Ci(2*c*f/d+2*f*x)*cos(-2*e+2*c*f/d)/d+2*a^2*Ci(c*f/d+f*x)*cos(-e+c *f/d)/d+3/2*a^2*ln(d*x+c)/d+1/2*a^2*Si(2*c*f/d+2*f*x)*sin(-2*e+2*c*f/d)/d+ 2*a^2*Si(c*f/d+f*x)*sin(-e+c*f/d)/d
Time = 0.78 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.79 \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\frac {a^2 \left (4 \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (f \left (\frac {c}{d}+x\right )\right )+\cos \left (2 e-\frac {2 c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {2 f (c+d x)}{d}\right )+3 \log (c+d x)-4 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )-\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 d} \]
(a^2*(4*Cos[e - (c*f)/d]*CosIntegral[f*(c/d + x)] + Cos[2*e - (2*c*f)/d]*C osIntegral[(2*f*(c + d*x))/d] + 3*Log[c + d*x] - 4*Sin[e - (c*f)/d]*SinInt egral[f*(c/d + x)] - Sin[2*e - (2*c*f)/d]*SinIntegral[(2*f*(c + d*x))/d])) /(2*d)
Time = 0.56 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 3799, 3042, 3793, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(a \cos (e+f x)+a)^2}{c+d x} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (e+f x+\frac {\pi }{2}\right )+a\right )^2}{c+d x}dx\) |
\(\Big \downarrow \) 3799 |
\(\displaystyle 4 a^2 \int \frac {\cos ^4\left (\frac {e}{2}+\frac {f x}{2}\right )}{c+d x}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle 4 a^2 \int \frac {\sin \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{2}\right )^4}{c+d x}dx\) |
\(\Big \downarrow \) 3793 |
\(\displaystyle 4 a^2 \int \left (\frac {\cos (e+f x)}{2 (c+d x)}+\frac {\cos (2 e+2 f x)}{8 (c+d x)}+\frac {3}{8 (c+d x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle 4 a^2 \left (\frac {\operatorname {CosIntegral}\left (x f+\frac {c f}{d}\right ) \cos \left (e-\frac {c f}{d}\right )}{2 d}+\frac {\operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{8 d}-\frac {\sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{2 d}-\frac {\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{8 d}+\frac {3 \log (c+d x)}{8 d}\right )\) |
4*a^2*((Cos[e - (c*f)/d]*CosIntegral[(c*f)/d + f*x])/(2*d) + (Cos[2*e - (2 *c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*x])/(8*d) + (3*Log[c + d*x])/(8*d) - (Sin[e - (c*f)/d]*SinIntegral[(c*f)/d + f*x])/(2*d) - (Sin[2*e - (2*c*f)/d ]*SinIntegral[(2*c*f)/d + 2*f*x])/(8*d))
3.2.26.3.1 Defintions of rubi rules used
Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> In t[ExpandTrigReduce[(c + d*x)^m, Sin[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f , m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1]))
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Simp[(2*a)^n Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
Time = 1.06 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.36
method | result | size |
derivativedivides | \(\frac {\frac {f \,a^{2} \left (\frac {2 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {2 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}\right )}{4}+\frac {3 f \,a^{2} \ln \left (c f -d e +d \left (f x +e \right )\right )}{2 d}+2 f \,a^{2} \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )}{f}\) | \(197\) |
default | \(\frac {\frac {f \,a^{2} \left (\frac {2 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {2 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}\right )}{4}+\frac {3 f \,a^{2} \ln \left (c f -d e +d \left (f x +e \right )\right )}{2 d}+2 f \,a^{2} \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )}{f}\) | \(197\) |
parts | \(\frac {a^{2} \ln \left (d x +c \right )}{d}+\frac {a^{2} \operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{2 d}+\frac {a^{2} \operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{2 d}+\frac {a^{2} \ln \left (c f -d e +d \left (f x +e \right )\right )}{2 d}+2 a^{2} \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )\) | \(203\) |
risch | \(-\frac {a^{2} {\mathrm e}^{\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (i f x +i e +\frac {i \left (c f -d e \right )}{d}\right )}{d}-\frac {a^{2} {\mathrm e}^{-\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (-i f x -i e -\frac {i c f -i d e}{d}\right )}{d}+\frac {3 a^{2} \ln \left (d x +c \right )}{2 d}-\frac {a^{2} {\mathrm e}^{\frac {2 i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (2 i f x +2 i e +\frac {2 i \left (c f -d e \right )}{d}\right )}{4 d}-\frac {a^{2} {\mathrm e}^{-\frac {2 i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (-2 i f x -2 i e -\frac {2 \left (i c f -i d e \right )}{d}\right )}{4 d}\) | \(216\) |
1/f*(1/4*f*a^2*(2*Si(2*f*x+2*e+2*(c*f-d*e)/d)*sin(2*(c*f-d*e)/d)/d+2*Ci(2* f*x+2*e+2*(c*f-d*e)/d)*cos(2*(c*f-d*e)/d)/d)+3/2*f*a^2*ln(c*f-d*e+d*(f*x+e ))/d+2*f*a^2*(Si(f*x+e+(c*f-d*e)/d)*sin((c*f-d*e)/d)/d+Ci(f*x+e+(c*f-d*e)/ d)*cos((c*f-d*e)/d)/d))
Time = 0.30 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.00 \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\frac {a^{2} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) \operatorname {Ci}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + 4 \, a^{2} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) + a^{2} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + 4 \, a^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) + 3 \, a^{2} \log \left (d x + c\right )}{2 \, d} \]
1/2*(a^2*cos(-2*(d*e - c*f)/d)*cos_integral(2*(d*f*x + c*f)/d) + 4*a^2*cos (-(d*e - c*f)/d)*cos_integral((d*f*x + c*f)/d) + a^2*sin(-2*(d*e - c*f)/d) *sin_integral(2*(d*f*x + c*f)/d) + 4*a^2*sin(-(d*e - c*f)/d)*sin_integral( (d*f*x + c*f)/d) + 3*a^2*log(d*x + c))/d
\[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=a^{2} \left (\int \frac {2 \cos {\left (e + f x \right )}}{c + d x}\, dx + \int \frac {\cos ^{2}{\left (e + f x \right )}}{c + d x}\, dx + \int \frac {1}{c + d x}\, dx\right ) \]
a**2*(Integral(2*cos(e + f*x)/(c + d*x), x) + Integral(cos(e + f*x)**2/(c + d*x), x) + Integral(1/(c + d*x), x))
Result contains complex when optimal does not.
Time = 0.45 (sec) , antiderivative size = 339, normalized size of antiderivative = 2.34 \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\frac {\frac {4 \, a^{2} f \log \left (c + \frac {{\left (f x + e\right )} d}{f} - \frac {d e}{f}\right )}{d} - \frac {4 \, {\left (f {\left (E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f {\left (i \, E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) - i \, E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} a^{2}}{d} - \frac {{\left (f {\left (E_{1}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) + E_{1}\left (-\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - f {\left (i \, E_{1}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) - i \, E_{1}\left (-\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right )\right )} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - 2 \, f \log \left ({\left (f x + e\right )} d - d e + c f\right )\right )} a^{2}}{d}}{4 \, f} \]
1/4*(4*a^2*f*log(c + (f*x + e)*d/f - d*e/f)/d - 4*(f*(exp_integral_e(1, (I *(f*x + e)*d - I*d*e + I*c*f)/d) + exp_integral_e(1, -(I*(f*x + e)*d - I*d *e + I*c*f)/d))*cos(-(d*e - c*f)/d) + f*(I*exp_integral_e(1, (I*(f*x + e)* d - I*d*e + I*c*f)/d) - I*exp_integral_e(1, -(I*(f*x + e)*d - I*d*e + I*c* f)/d))*sin(-(d*e - c*f)/d))*a^2/d - (f*(exp_integral_e(1, 2*(-I*(f*x + e)* d + I*d*e - I*c*f)/d) + exp_integral_e(1, -2*(-I*(f*x + e)*d + I*d*e - I*c *f)/d))*cos(-2*(d*e - c*f)/d) - f*(I*exp_integral_e(1, 2*(-I*(f*x + e)*d + I*d*e - I*c*f)/d) - I*exp_integral_e(1, -2*(-I*(f*x + e)*d + I*d*e - I*c* f)/d))*sin(-2*(d*e - c*f)/d) - 2*f*log((f*x + e)*d - d*e + c*f))*a^2/d)/f
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.43 (sec) , antiderivative size = 6693, normalized size of antiderivative = 46.16 \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\text {Too large to display} \]
1/4*(6*a^2*log(abs(d*x + c))*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2*tan(1/2*c* f/d)^2 + a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*e)^2*tan(e)^ 2*tan(c*f/d)^2*tan(1/2*c*f/d)^2 + 4*a^2*real_part(cos_integral(f*x + c*f/d ))*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2*tan(1/2*c*f/d)^2 + 4*a^2*real_part(c os_integral(-f*x - c*f/d))*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2*tan(1/2*c*f/ d)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*e)^2*tan(e)^2 *tan(c*f/d)^2*tan(1/2*c*f/d)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d) )*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2*tan(1/2*c*f/d) + 8*a^2*imag_part(cos_ integral(-f*x - c*f/d))*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2*tan(1/2*c*f/d) - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)^2* tan(1/2*c*f/d) - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*e) ^2*tan(e)^2*tan(c*f/d)*tan(1/2*c*f/d)^2 + 2*a^2*imag_part(cos_integral(-2* f*x - 2*c*f/d))*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)*tan(1/2*c*f/d)^2 - 4*a^2* sin_integral(2*(d*f*x + c*f)/d)*tan(1/2*e)^2*tan(e)^2*tan(c*f/d)*tan(1/2*c *f/d)^2 + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*e)^2*tan( e)*tan(c*f/d)^2*tan(1/2*c*f/d)^2 - 2*a^2*imag_part(cos_integral(-2*f*x - 2 *c*f/d))*tan(1/2*e)^2*tan(e)*tan(c*f/d)^2*tan(1/2*c*f/d)^2 + 4*a^2*sin_int egral(2*(d*f*x + c*f)/d)*tan(1/2*e)^2*tan(e)*tan(c*f/d)^2*tan(1/2*c*f/d)^2 + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*e)*tan(e)^2*tan(c*f/ d)^2*tan(1/2*c*f/d)^2 - 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan...
Timed out. \[ \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx=\int \frac {{\left (a+a\,\cos \left (e+f\,x\right )\right )}^2}{c+d\,x} \,d x \]